let app = getApp();
var httptool = require("../../utils/zry.httptool.js");
var tabjs = require("../../utils/tab.js");
Page({
  data:{
    activeIndex:2,
    openId:'',
    unionId:'',
    img:'',
    msgprop:'',//消息提示 
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    this.getImgUrl();
    this.setData({ activeIndex: options.id, openId: options.openId, unionId: options.unionId });
  },
  registerBtn:function(e){
    wx.navigateTo({
      url: '/pages/register/register?openId=' + this.data.openId + '&unionId=' + this.data.unionId
    });
  },
  daLei: function (e) {
    httptool.login(function () {
      tabjs.daleiBtnClick();
    });   
  },
  myCenter:function(e){
    wx.redirectTo({
      url: '/pages/myCenter/myCenter',
    })
  },
  leiCircle:function(e){
    wx.redirectTo({
      url: '/pages/index/index',
    })
  },
  getImgUrl:function(e){
    let that=this;
    httptool.ajaxBasePost("api/BannerPicture/GetBannerPictureByType", { BannerType:'Register'}, function (res) { 
      if(res.suc){
          let datas=res.data;
          that.setData({img:datas[0].ImgUrl});
      }
    })
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  }
})